<template>
    <a-result status="404" title="404" style="background: none" sub-title="Sorry, the page you visited does not exist.">
        <template #extra>
            <!-- <router-link to="/"> -->
            <a-button type="primary" @click="goFirst">Back Home</a-button>
            <!-- </router-link> -->
        </template>
    </a-result>
</template>

<script lang="ts">
    import { defineComponent } from 'vue';
    import { useUserStore } from '@/store/user';
    import { useRouter } from 'vue-router';
    export default defineComponent({
        name: 'Exception404',
        setup() {
            const userStore = useUserStore();
            const router = useRouter();
            const goFirst = () => {
                if (userStore.menus) {
                    router.push(userStore.menus[0].children[0].path);
                } else {
                    router.push('/list/project-list');
                }
            };
            return {
                goFirst,
            };
        },
    });
</script>
